package com.yao.club.service;

import com.netease.yidun.sdk.core.utils.StringUtils;
import com.yao.club.entity.*;
import com.yao.club.entity.dto.*;
import com.yao.club.entity.request.CommentRequestEntity;
import com.yao.club.entity.request.PostsCreateRequestEntity;
import com.yao.club.entity.result.ResponseEntity;
import com.yao.club.entity.result.ResultEntity;
import com.yao.club.entity.vo.PostsCommentVO;
import com.yao.club.entity.vo.PostsInfoVO;
import com.yao.club.mapper.*;
import com.yao.club.reposittory.*;
import com.yao.club.utils.ResponseUtils;
import org.apache.hc.core5.util.TextUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public interface PostsInfoService {

    /**
     * 校验帖子
     * @param postsId
     * @return
     */
    ResponseEntity<Boolean> giveValidationLike(String postsId);

    /**
     * 根据id获得帖子详情
     * @param postsId
     * @return
     */
    ResponseEntity<PostsInfoVO> getByPostsId(String postsId);

    /**
     * 分页获得帖子评论信息
     */
    ResponseEntity<ResultEntity> pageComment(String postsId, int pageNum, int pageSize);
    List<PostsCommentVO> getCommentsByPostsId(String postsId);

    /**
     * 发布评论
     * @param request
     * @param username
     * @return
     */
    ResponseEntity<Boolean> addComment(CommentRequestEntity request,String username);

    /**
     * 发布评论
     * @param commentRequest
     * @param username
     * @return
     */
    ResponseEntity<Boolean> replyComment(CommentRequestEntity commentRequest,String username);
    /**
     * 点赞帖子
     * @param postsId
     * @param username
     * **/
    ResponseEntity<Boolean> giveLike(Long postsId, String username);
    /**
     * 收藏贴子
     * @param postsId
     * @param username
     * **/
    ResponseEntity<Boolean> giveCollect(Long postsId, String username);
    /**
     * 分享贴子
     * @param postsId
     * @param username
     * **/
    ResponseEntity<Boolean> giveShare(Long postsId, String username,String share_type);

    /**
     * 屏蔽贴子
     * @param postsId
     * @param username
     * **/
     ResponseEntity<Boolean> shield(Long postsId, String username);
 /**
     * 分页查询帖子列表
     * @param pageNum 页码
     * @param pageSize 每页数量
     * @param sortType 排序类型
     * @param username 当前登录用户（可能为null）
     * @return 帖子列表结果
     */
     ResponseEntity<ResultEntity<PostsInfoVO>> pageList(String topicId, String keyword, Integer pageNum, Integer pageSize, String sortType, String memberId,Integer isFocus,String username);

    /**
     * 发布帖子
     */
    ResponseEntity<Boolean> createPost(PostsCreateRequestEntity request, String username);

}
